****
** Replication File:
**
** Who Supports QAnon? A Case Study in Political Extremism
**
** March 2020 Data
****

set more off

* Set working directory

* Open dataset
use "Clean Data, March 2020.dta"

********************************************************************************

****
** Table 1
****

pwcorr pidstrength ideostrength qanonft conthink triad ///
	falseinfo violence, obs sig

****
** Table 2 and Table A8 (full results in appendix) 
****	

* PID	
reg qanonft2 pid2 pidsq2 edu2 attend2 ///
	age2 income2 female black hispanic 
est sto mod1
reg qanonft2 conthink2 triad2 falseinfo2 violence2 pid2 pidsq2 ///
	edu2 attend2 age2 income2 female black hispanic 
est sto mod2

* IDEO
reg qanonft2 ideo2 ideosq2 edu2 attend2 ///
	age2 income2 female black hispanic
est sto mod3
reg qanonft2 conthink2 triad2 falseinfo2 violence2 ideo2 ideosq2 ///
	edu2 attend2 age2 income2 female black hispanic 
est sto mod4	

estout mod1 mod2 mod3 mod4, cells(b(star fmt(3)) se(par fmt(3))) ///
   legend label varlabels(_cons constant) stats(r2 N, fmt(3 0 1))	
	
estimates table mod1 mod2 mod3 mod4, ///
	b(%10.3f) se(%10.3f) stats(r2 N)   

putdocx begin
putdocx table tbl1 = etable, width(100%)
putdocx save reg2020.docx, replace	

****
** Predictions for Figure 2
** (stored in "Predictions.csv")
****

reg qanonft conthink2 triad2 falseinfo2 violence2 pid2 pidsq2 ///
	edu2 attend2 age2 income2 female black hispanic 
margins, at(pid2=0 pidsq2=0)
margins, at(pid2=.25 pidsq2=.125)
margins, at(pid2=.5 pidsq2=.3333333)
margins, at(pid2=.75 pidsq2=.625)
margins, at(pid2=1 pidsq2=1)

margins, at(conthink2=(0(.1)1))
margins, at(triad2=(0(.1)1))
margins, at(falseinfo2=(0(.25)1))
margins, at(violence2=(0(.125)1))

reg qanonft conthink2 triad2 falseinfo2 violence2 ideo2 ideosq2 ///
	edu2 attend2 age2 income2 female black hispanic 
margins, at(ideo2=0 ideosq2=0)
margins, at(ideo2=0.1666667 ideosq2=0.0625)
margins, at(ideo2=0.3333333 ideosq2=0.166667)
margins, at(ideo2=0.5 ideosq2=0.3125)
margins, at(ideo2=0.6666667 ideosq2=0.5)
margins, at(ideo2=0.8333333 ideosq2=0.7291667)
margins, at(ideo2=1 ideosq2=1)

****
** Predictions for Figure A3
** (stored in Predictions, IDEO.csv")
****

reg qanonft conthink2 triad2 falseinfo2 violence2 ideo2 ideosq2 ///
	edu2 attend2 age2 income2 female black hispanic 
margins, at(conthink2=(0(.1)1))
margins, at(triad2=(0(.1)1))
margins, at(falseinfo2=(0(.25)1))
margins, at(violence2=(0(.125)1))

****
** Table A9
****

pwcorr qanonft conthink narcissism sociopathy ///
	manipulate falseinfo violence, sig
		
****
** Reliability information for
** Appendix
****

* Conspiratorial thinking
alpha con1-con4
sum conthink

* Machiavellianism
alpha manip1-manip4
sum manipulate

* Narcissism
alpha attent1-attent4
sum narcissism

* Psychopathy
alpha insens1-insens4
sum sociopathy

* Violence
alpha vio1 vio2
sum violence

* Dark triad
alpha manip1-manip4 attent1-attent4 insens1-insens4
sum triad


clear	
